<?php 
include  "./../protected.php"; /*Valida el inico de sesion*/
?>
<!doctype html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Agregar académicos</title>
  <link rel="stylesheet" type="text/css" href="mtb.css"/>
  <link rel="stylesheet" type="text/css" href="main.css"/>
  <link rel="stylesheet" type="text/css" href="ceGrid.css"/>
  <script type="text/javascript" src="../../../js/jquery.js"></script>
  <link rel="stylesheet" type="text/css" href="../../../css/index.css" />
  <script>

   
    function soloLetras(e){
       key = e.keyCode || e.which;
       tecla = String.fromCharCode(key).toLowerCase();
       letras = " áéíóúabcdefghijklmnñopqrstuvwxyz";
       especiales = "8-37-39-46";

       tecla_especial = false
       for(var i in especiales){
            if(key == especiales[i]){
                tecla_especial = true;
                break;
            }
        }

        if(letras.indexOf(tecla)==-1 && !tecla_especial){
            return false;
        }
    }
</script>
  
  
</head>

<!--------------------------------------------------------------------------->
<body>
 <a class="btn" href="index.php">Lista académicos</a>
	<div id="content-mt">
		
		<form name="Reg_academico" method="POST" id="form-pro" class="style" > 

<div id="div01"  class="curved" >
<table id = "tab01">
<div id="error"></div>
	<tr align="center">
	
   		  <tr>
	     		<td>Académico</td>
        		<td><label>
             		<input type="text" name="Txt_GS01NOAC" id="datos" placeholder="Ingrese el nombre" value = "" maxlength="80"  onkeypress="return soloLetras(event)"/> 
         
         			</label></td>
   		 </tr>
  <!--  <script> if( ! ("autofocus" in document.createElement( "input" ) ) ) {
                    document.getElementById( "Txt_GS01NOAC" ).focus();}
    </script>  -->
		<tr>
	    	    <td>Documento</td>
         	    <td><label>
         		<input type="text" name="Txt_GS01DOCA" id="dato" value = ""  maxlength="10" /> 
         
         		</label></td>
       </tr>
       
       <tr>
         <td></td>
         <td><label>
         <input type="submit" name="Agregar_Btn" class="btn-m"  id="Agregar_Btn" value="Agregar" />
         </label></td>
     </tr>
     </tr>
</table> 
 </form>
</div>
</div>
</body>
<!--script de validacion formulario-->
<script type="text/javascript">
    
    $(function(){
        $("#datos").focus();
    $("#form-pro").submit(function(e){
        e.preventDefault();
    var form_data= {    
           datos:$("#datos").val(),
		   dato:$("#dato").val(),

           

        };

        $.ajax({
          type:"POST",
            url:"Insert.php",
            data:form_data,
            success: function(responde){
       
                     
                    $("#error").html(responde);
            }

        });
    });
    });
</script>
</html>

